package com.kuyun.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kuyun.entity.Comment;
import com.kuyun.mapper.CommentMapper;
import com.kuyun.service.CommentService;

@Service
public class CommentServiceImpl implements CommentService {

	@Autowired
	private CommentMapper commentMapper;

	// 查询所有评论
	public List<Comment> findAllComment() {
		// TODO Auto-generated method stub
		try {
			return commentMapper.findAllComment();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	// 删除单个评论
	public boolean delComment(Integer id) {
		try {
			return commentMapper.delComment(id) >= 1 ? true : false;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}

}
